#include ("/_includes/_layout.html")
#@layout("点步插件平台--模板中心", "wxmall,点步科技", "Wxmall社区","wxmall")
#define css()
<style>
.iipxjf{
	border-radius: 4px;
	border: 1px solid #e7eaec;
	overflow: hidden;
}
.jsONNa{
	float:left;
	text-align: center;
}
.dgMvjz,.jtiAZd{
	font-size: 10px;
}
.bjmPCA {
    font-size: 14px;
    color: #313131;
    margin: 10px 0;
}
.dzlqyF {
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #03a854;
}

.iIjmuk-box{
    border-radius: 4px;
	float: left;
	padding:0px 15px 15px;
	
}
.iIjmuk {
    position: relative;
    background-color: #fff;
    margin-bottom: 20px;
    border-radius: 4px;
}
.jIeewA{
	padding: 16px;
	border: 1px solid #e7eaec;
	padding: 10px;
	overflow: hidden;
	background-color: #fbfcfd
}

.eCNVCe {
    overflow: hidden;
    position: relative;
}
.gRCHRu {
    width: 100%;
    height: 100%;
    margin-right: 5px;
    margin-top: 5px;
}
.cvtaBP {
    height: 24px;
    line-height: 24px;
    font-size: 14px;
    position: relative;
    left:10px;
    margin: 0px;
}
.cvtaDESC{
	font-size: 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap; 
	position: relative;
    left:10px;
    color: #979899;
    width: 60%;
    margin: 0px;
}
.explain-box{
	padding-top: 15px;
	padding-bottom: 15px;
}
.deadline-box{
	text-align: center;
	position: absolute;
	width: 100%;
	bottom: 15px;
}
.irthqT{
	font-size: 14px;
    color: #3e3e3e;
    margin-top: 17px;
    margin-bottom: 13px;
}
.kNaOOG {
    border-radius: 33px;
    background-color: #f5f5f5;
    display: inline-block;
    padding:6px 20px;
    margin: 20px auto 0px;
    color: #565656;
}
.kNaOOG .font-bold{
	padding: 20px 20px;
}
</style>
#end
#define content()
<div class="wrapper wrapper-content">
	<div class="ibox-content" style="padding: 20px 0px;">
		<div class="col-md-3" style="padding-right: 0px;">
            <div class="ibox float-e-margins" >
                <div class="ibox-content" style="padding:0px;">
                    #if (session.weapp_in_session??)
                    <div class="euIMud">
                      <div class="iipxjf">
						<div class="dropdown profile-element" style="margin-bottom: 5px;text-align: center;margin-top: 30px;padding: 10px 0px;">
		                    <span><img alt="image" style="width: 60px;height: 60px;border-radius: 50%" src="#(session.weapp_in_session.head_img)" /></span>
		                    <span class="clear"><span class="block m-t-xs irthqT"><strong class="font-bold" style="font-size: 12px;">#(session.weapp_in_session.nick_name)</strong></span></span>
		                    <span class="clear"><span class="block m-t-xs kNaOOG"><strong class="font-bold" style="font-size: 12px;">累计访问数:<span id="sparkline4">0</span></strong></span></span>
		                </div>
		                <div style="margin: 50px 15px 30px;overflow: hidden;padding-top: 50px;border-top: 1px solid #e7eaec;">
			                <div class="first-card sc-bGbJRg jsONNa col-md-4" style="padding-left: 15px;">
							  <div class="sc-drMfKT dgMvjz">转发次数</div>
							   <div class="sc-bEjcJn bjmPCA"><span id="sparkline1">0</span></div>
							</div>
							<div class="first-card sc-bGbJRg jsONNa col-md-4">
							  <div class="sc-drMfKT dgMvjz">转发人数</div>
							   <div class="sc-bEjcJn bjmPCA"><span id="sparkline2">0</span></div>
							</div>
							<div class="first-card sc-bGbJRg jsONNa col-md-4" style="padding-right: 15px;">
							  <div class="sc-drMfKT dgMvjz">累计用户数</div>
							   <div class="sc-bEjcJn bjmPCA"><span id="sparkline3">0</span></div>
							</div>
						</div>
                      </div>
                    </div>
                    #end
                </div>
            </div>
        </div>
        <div class="col-md-9" style="padding-left: 0px;padding-bottom:100px">
        	#if(template??)
	         <div class="col-sm-12 col-md-12" style="padding-bottom: 20px;" id="commend">
				<div class="col-sm-12 col-md-12" style="background-color: #f5f5f5;color: #333;border-color:#d1dade;height: 35px;line-height: 35px;font-size: 18px;">正在使用中的模板</div>
	         	<div class="ibox-content">
	         	<div class="ibox" style="padding:10px 15px 15px 15px;border-bottom:1px solid #FFE4C4">
			    <div>
			    <h2>#(template.templateName??)</h2>
                <p>#(template.versionDesc??)</p>
			    </div>
			    </div>
	         	</div>
	         </div>
	        #else
	        <div class="col-sm-12 col-md-12" style="padding-bottom: 20px;" id="commend">
				<div class="alert alert-danger">当前小程序还没有设置模板</div> 
			</div>	
	        #end 
	        #if(templates??)
	         <div class="col-sm-12 col-md-12" style="padding-bottom: 20px;" id="redpack">
				<div class="col-sm-12 col-md-12" style="background-color: #f5f5f5;color: #333;border-color:#d1dade;height: 35px;line-height: 35px;font-size: 18px;">模板列表</div>
	         	
	         	<div class="ibox-content">
					 #for(tpl : templates)
			          <div class="ibox" style="padding:10px 15px 15px 15px;border-bottom:1px solid #FFE4C4">
			              <div>
			                  <h2>#(tpl.templateName??)</h2>
			                  <p>#(tpl.versionDesc??)</p>
			                  #if(tpl.active??)
			                  <div>
			                      <a class="btn btn-primary btn-xs" href="#(webctx)/weapp/sets/step1/?id=#(tpl.id??)">立即使用</a>
			                  </div>
			                  #else
			                  <div>
			                      <a class="btn btn-default btn-xs" href="javascript:void(0)">即将上线</a>
			                  </div>
			                  #end
			              </div>
			          </div>
			          #end
				</div>
	         </div>
	        #end 
        </div>
    </div>
</div>
#define script()
<script type="text/javascript">
$(document).ready(function(){
	obz.ajaxJson("#(webctx)/weapp/stat/survey",{},function(resp){
		if(resp.code==200){
			var list = resp.data.list;
			if(list){
				var data = list[0];
				$("#sparkline1").text(data.share_pv);
				$("#sparkline2").text(data.share_uv);
				$("#sparkline3").text(data.visit_total);
				$("#sparkline4").text(data.visit_total);
			}
		}
	});
});
</script>
#end
#end